package com.register.client.start;

import com.register.client.common.ResultResponse;
import com.register.client.domian.ClientCachedServiceRegistry;
import com.register.client.domian.ClientServiceInstance;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/query")
public class CaptainClientQuery {

    @RequestMapping("/getRegistry")
    public ResultResponse getRegistry(){
        Map<String, Map<String, ClientServiceInstance>> registry = ClientCachedServiceRegistry.getRegistry();
        return ResultResponse.ofSuccess(registry);
    }
}
